home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / util / batch / ScriptTools.lha / ScriptTools / ScriptTools.doc < prev    next >
Encoding:
Text File  |  1994-01-22  |  3.7 KB  |  125 lines

  1.                                 Script Tools
  2.                                 ====== =====
  3.  
  4.                                      By
  5.                                Keith R. Burby
  6.  
  7.  
  8. Copyright
  9.  
  10. These programs, their source code, and this document are placed in the
  11. public
  12. domain.  As a courtesy, I only ask that when you distribute these files,
  13. please distribute them in their original un-modified form.
  14.  
  15.  
  16. Warranty
  17.  
  18. The author offers no warrantee or accepts any responsibility for the
  19. consequences of using these programs.  Use these programs AT YOUR OWN RISK.
  20.  
  21.  
  22. So, What are These Tools?
  23.  
  24. The three programs are Basename, Pathname, and TackOn.  Former users of the
  25. ARP replacement shell will recognize the first and last commands.  Basename
  26. takes a complete path/file name and extracts the base filename and
  27. optionally strip off a specified suffix as well.  TackOn does pretty much
  28. does the opposite, it takes a pathname and filename and appends the latter
  29. to the former.  Pathname, which is new, will take the complete path/file
  30. name and extract the pathname.
  31.  
  32.  
  33. Usage
  34.  
  35. With all three programs, enter a question mark will, of course, display the
  36. template.
  37.  
  38. Program:    Basename
  39. Template:   NAME/A,SUFFIX
  40. Arguments:  NAME = Complete path/file name to extract the basename from.
  41.             SUFFIX = Optional suffix to strip off.
  42. Example:    Basename RAM:ScriptTools/Basename.mod .mod
  43. Returns:    Basename
  44.  
  45. Program:    TackOn
  46. Template:   PATH/A,FILE/A
  47. Arguments:  PATH = Name of path to be appended to.
  48.             FILE = Filename to append to the path.
  49. Example:    TackOn RAM:ScriptTools TackOn.mod
  50. Returns:    RAM:ScriptTools/TackOn.mod
  51.  
  52. Program:    Pathname
  53. Template:   NAME/A
  54. Arguments:  NAME = Complete path/file name to extract the pathname from.
  55. Example:    Pathname RAM:ScriptTools/Pathname.mod
  56. Returns:    RAM:ScriptTools
  57.  
  58. All three programs require AmigaDOS 2.0 or better and are pure and can be
  59. made resident.
  60.  
  61.  
  62. So, What Good are These Programs?
  63.  
  64. These programs were designed to be primarily used inside a script file, or
  65. more specifically, within back-quotes (``) to send their information to
  66. another command's command line.  Here's an example, albeit pointless,
  67.  
  68. script to show these tools in action.
  69.  
  70. .key Fullname/A,Destination/A
  71.  
  72. CD "`Pathname <Fullname>`"
  73.  
  74. Set Basename "`Basename <Fullname>`"
  75. Set Barename "`Basename <Fullname> .mod`"
  76.  
  77. If exists "$Barename"
  78.   Copy "$Barename" to "<Destination>"
  79. EndIf
  80.  
  81. If exists "$Basename"
  82.   Copy "$Basename" to "`TackOn "<Destination>" "$Barename"`.mud"
  83. Else
  84.   Echo "Couldn't find $Basename."
  85.   Quit 10
  86. EndIf
  87. Quit 0
  88.  
  89. This script simply copies a Modula/Oberon source file to the destination
  90. directory, changing the suffix to ".mud" and copies the binary file, if it
  91. exists, to the destination directory.  (I tool you it was pointless. :>)
  92.  
  93.  
  94. What These Programs Don't Do.
  95.  
  96. These programs don't check if the specified file or path actually exist.
  97. AmigaDOS already provides those capabilities.
  98.  
  99. Nor do these programs check if the specified path or file names are proper
  100. names.  If you specify a path with a dozen subdirectories or a filename
  101. with over the legal 32 characters (OS2.x's command line can be up to 512
  102. characters long), these programs will work with them, but I make no
  103. guarantees as to what their result will be.
  104.  
  105.  
  106. Finally,
  107.  
  108. If you have any suggestions, comments, bug reports, flames (go easy on me,
  109. this is my first time :>), or whatever, I can be reached, via mail, at:
  110.  
  111. Keith R. Burby
  112. 3800 Teeple Lake Road
  113. White Lake, MI  48383-3141
  114. USA
  115.  
  116. or via E-Mail at:
  117.  
  118. kb0s2113@sycom.mi.org
  119. or
  120. Arcane@lppl.mi.org
  121.  
  122. As always.
  123.                                                       K/B
  124.                                                       ~~~
  125.